﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace MyImdb.Models
{
    [DataContract, KnownType(typeof(Episode))]
    public class ImdbItem
    {
        //TODO
        [DataMember(Name = "runtime", EmitDefaultValue = false)]
        public List<string> RunTime { get; set; } 

        [DataMember(Name = "rating", EmitDefaultValue = false)]
        public double Rating { get; set; }

        [DataMember(Name = "genres", EmitDefaultValue = false)]
        public List<string> Genres { get; set; }

        //TODO
        [DataMember(Name = "rated", EmitDefaultValue = false)]
        public string Rated { get; set; } 

        [DataMember(Name = "language", EmitDefaultValue = false)]
        public List<string> Language { get; set; }

        [DataMember(Name = "plot", EmitDefaultValue = false)]
        public string Plot { get; set; }

        [DataMember(Name = "title", EmitDefaultValue = false)]
        public string Title { get; set; }

        [DataMember(Name = "filming_locations", EmitDefaultValue = false)]
        public string FilmingLocations { get; set; }

        [DataMember(Name = "poster", EmitDefaultValue = false)]
        public string Poster { get; set; }

        [DataMember(Name = "imdb_url", EmitDefaultValue = false)]
        public string ImdbUrl { get; set; }

        [DataMember(Name = "writers", EmitDefaultValue = false)]
        public List<string> Writers { get; set; }

        [DataMember(Name = "imdb_id", EmitDefaultValue = false)]
        public string ImdbId { get; set; }

        [DataMember(Name = "episodes", EmitDefaultValue = false)]
        public List<Episode> Episodes { get; set; }

        [DataMember(Name = "directors", EmitDefaultValue = false)]
        public List<string> Directors { get; set; }

        [DataMember(Name = "rating_count", EmitDefaultValue = false)]
        public int RatingCount { get; set; }

        [DataMember(Name = "actors", EmitDefaultValue = false)]
        public List<string> Actors { get; set; }

        [DataMember(Name = "plot_simple", EmitDefaultValue = false)]
        public string PlotSimple { get; set; }

        [DataMember(Name = "year", EmitDefaultValue = false)]
        public int Year { get; set; }

        [DataMember(Name = "country", EmitDefaultValue = false)]
        public List<string> Country { get; set; }

        [DataMember(Name = "type", EmitDefaultValue = false)]
        public string Type { get; set; }

        [DataMember(Name = "release_date", EmitDefaultValue = false)]
        public int ReleaseDate { get; set; }

        [DataMember(Name = "also_known_as", EmitDefaultValue = false)]
        public List<string> AlsoKnownAs { get; set; }
    }

    [DataContract]
    public class Episode
    {
        [DataMember(Name = "season", EmitDefaultValue = false)]
        public int Season { get; set; }

        [DataMember(Name = "episode", EmitDefaultValue = false)]
        public int EpisodeSL { get; set; }

        [DataMember(Name = "title", EmitDefaultValue = false)]
        public string Title { get; set; }
    }
}
